import java.util.*;

public class MapHost{

	private ArrayList<Map> world;
	private int maxWidth;
	private int maxHeight;
	private ArrayList<MapPreferences> worldPrefs;
	private Random rm = new Random();
	
	public MapHost(int w, int h){
		maxWidth=w;
		maxHeight=h;
		world = new ArrayList<Map>();
	}
	
	public Map getMap(int d){
		if(d >= world.size()){
			//generateMap();
			return world.get(world.size()-1);
		}
		return world.get(d);
	}
	
	public void initWorld(){
		int j = 0;
		world.add(new Map());
		for(int i = 0; i<16; i++){
			for(j = 0; j<16; j++){
				if(i == 0 || i == 14 || j == 0 || j == 14){
					world.get(0).addTile(new WallTile( '#', j, i));
				}
				else{ world.get(0).addTile(new WalkTile( ' ', j, i)); }
			}
		}
		
		world.get(0).setTile(new PortalTile('v', 8, 6, 0));
	}
	
	public void paintWorld(int lvl){
		world.get(lvl).printTiles();
	}
	
	/*
	private void generateMap(){
		
		// -> Call mapcreator with preferences
			// -> Used preference's portal count needs to be same on adjacent dungeon levels
		// -> Connect portals
	}
	
	public void rebuildWorld(){
		// Angry SQL queries are angry
	}
	
	public void storeWorld(){
		// SQL stores are angry also
	}
	*/
}